/*---------------------------------------------------
-----------------------------------------------------
Filename:	init_Autoresize.m
Version:	1.0

Type:		maki/attrib definitions
Date:		28. Okt. 2006 - 16:32 
Author:		Martin Poehlmann aka Deimos
E-Mail:		martin@skinconsortium.com
Internet:	www.skinconsortium.com
		www.martin.deimos.de.vu
-----------------------------------------------------
Depending Files:
		scripts/maximize.m
-----------------------------------------------------
---------------------------------------------------*/

#ifndef included
#error This script can only be compiled as a #include
#endif

#include "gen_pageguids.m"


Function initAttribs_Autoresize();


#define CUSTOM_PAGE_RESIZE "{E704AB5A-108E-4309-B54B-43EBA5C0C3AA}"

Global ConfigAttribute sui_autorsize_attrib, link_w_attrib, titlebar_dblclk_max_attib, titlebar_dblclk_shade_attib;

initAttribs_Autoresize()
{
	initPages();
	
	ConfigItem custom_page_autoresize = addConfigSubMenu(optionsmenu_page, "Window Sizing", CUSTOM_PAGE_RESIZE);

	sui_autorsize_attrib = custom_page_autoresize.newAttribute("Autoresize Main Window if maximized", "0");
	link_w_attrib = custom_page_autoresize.newAttribute("Link shade and player width", "1");
	addMenuSeparator(custom_page_autoresize);
	titlebar_dblclk_shade_attib = custom_page_autoresize.newAttribute("Switch to Shade on Titlebar Doubleclick", "1");
	titlebar_dblclk_max_attib = custom_page_autoresize.newAttribute("Maximize Window on Titlebar Doubleclick", "0");
}

#ifdef MAIN_ATTRIBS_MGR

titlebar_dblclk_shade_attib.onDataChanged()
{
	if (attribs_mychange) return;
	NOOFF
	attribs_mychange = 1;
	if (getData() == "1") titlebar_dblclk_max_attib.setData("0");
	if (getData() == "0") titlebar_dblclk_max_attib.setData("1");
	attribs_mychange = 0;
}
titlebar_dblclk_max_attib.onDataChanged()
{
	if (attribs_mychange) return;
	NOOFF
	attribs_mychange = 1;
	if (getData() == "1") titlebar_dblclk_shade_attib.setData("0");
	if (getData() == "0") titlebar_dblclk_shade_attib.setData("1");
	attribs_mychange = 0;
}

#endif